/*
	Handles the setup of the app, loads AngularJs
	dependencies and handles routing
	
*/
var appModule = angular.module('skiApp', [
	'ngRoute',
    'ngTouch'
]).config(function($routeProvider){
	
	$routeProvider
		// HOME PAGE
		.when('/', {
			templateUrl: 'app/components/home/homeView.html',
			controller: 'homeController',
			controllerAs: 'home'
		})
		
		// PROGRAM PAGE
		.when('/program', {
			templateUrl: 'app/components/program/programView.html',
			controller: 'programController',
			controllerAs: 'program'
		})
		// RESULT PAGE
		.when('/race-facts', {
			templateUrl: 'app/components/race-facts/race-factsView.html',
			controller: 'race-factsController',
			controllerAs: 'results'
		})
		// FOOD & DRINK PAGE
		.when('/food-and-drink', {
			templateUrl: 'app/components/food-and-drink/food-and-drinkView.html',
			controller: 'food-and-drinkController',
			controllerAs: 'food-and-drink'
		})
		// SOCIAL MEDIA PAGE
		.when('/some', {
			templateUrl: 'app/components/some/someView.html',
			controller: 'someController',
			controllerAs: 'some'
		})
		// INFO PAGE
		.when('/info', {
			templateUrl: 'app/components/info/infoView.html',
			controller: 'infoController',
			controllerAs: 'info'
		})
			// TICKETS PAGE
			.when('/info/tickets', {
				templateUrl: 'app/components/info/ticketsView.html',
				controller: 'ticketsController',
				controllerAs: 'tickets'
			})
			// GENERAL INFO PAGE
			.when('/info/general-info', {
				templateUrl: 'app/components/info/tView.html',
				controller: 'generalInfoController',
				controllerAs: 'generalInfo'
			})
			// MEET LAHTI PAGE
			.when('/info/general-info', {
				templateUrl: 'app/components/info/tView.html',
				controller: 'generalInfoController',
				controllerAs: 'generalInfo'
			})
			// FOR KIDS PAGE
			.when('/info/for-kids', {
				templateUrl: 'app/components/info/tView.html',
				controller: 'forKidsController',
				controllerAs: 'forKids'
			})
			
			
		
		.otherwise({
			redirectTo: '/'
		});
		
});
/*
angular.module('skiApp').controller('menuController', ['$scope', '$location', function($scope, $location) {
    $scope.location = $location;

    $scope.navigate = function(path) {
        switch(path){
            case 'home': $location.path('/'); break;
            case 'program': $location.path('/program'); break;
            case 'results': $location.path('/results'); break;
            case 'food-and-drink': $location.path('/food-and-drink'); break;
            case 'some': $location.path('/some'); break;
            case 'tickets': $location.path('/tickets'); break;
            case 'info': $location.path('/info'); break;
        }
    };
}]);
/*
skiApp.controller('appController', ['$scope', $function($scope){
	// stuff
}]);
*/
/*
angular.module('skiApp').config(['$routeProvider', '$locationProvider',
	function($routeProvider, $locationProvider) {
		$locationProvider.html5Mode(true);
		$routeProvider.otherwise({redirectTo:'/'});
	});
}]);
*/